<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="jt.classic.system.group.IGroup"%>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.HTMLTool"%>
<%@ page import="org.limp.mine.Controller"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%@ page import="jt.classic.system.wordbook.XWordbook"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[]) request.getAttribute("result");
	Label label = (Label) result[1];
	Controller controller = (Controller) result[2];
	String pageNO = (String) result[3];
	List resultList = (List) result[0];

	Map query = (Map) request.getAttribute("query");

	List list = (List) request.getAttribute("list");

	/*列表类型*/
	String listtype = "directory";//(String)request.getAttribute("listtype");

	String qname = (String) query.get("qname");
	String qtype = (String) query.get("qtype");
	String qdirec = (String) query.get("qdirec");
	String qdirecid = (String) query.get("qdirecid");
	String qdate = (String) query.get("qdate");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>信息审核(未通过)列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../head.jsp"></jsp:include>
<link rel="stylesheet" type="text/css"
	href="<%=context%>/app/info/css/directree.css" />
<script type="text/javascript"
	src="<%=context%>/app/info/js/lanmuselect.js"></script>
<script>
  var chk = false;
  function checkall(thizz){
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox"){
        chks[i].checked = !chk;
      }
    }
    
    chk = !chk;
  }
  
  function handleOK(id){
       var rnt = false;
	    var ids = "";
	    
	    if(id){
	    	rnt = true;
	        ids = id + ",";
	    }else{
		    var chks = document.getElementsByTagName("input");
		    for(var i=0;i<chks.length;i++){
			      if(chks[i].type == "checkbox" && chks[i].checked){
			        rnt = true;
			        ids += chks[i].value + ",";
			      }
		    }
	    }
	   
	    if(!rnt){
	      	  alert("请选择审核通过的信息");
	    }else if(confirm("确定审核通过")){
		      createHidden("ids", ids.substring(0,ids.length - 1));
		      
		      Ext.MessageBox.wait('提交处理过程中...');   
		      Ext.Ajax.request({       
			        //请求地址       
			       url: context + "/app/info.do?method=approveinfo",       
			       //提交参数组       
			       fileUpload: true,   
			       form: 'form2',   
			       scope: 'form2',     
			       //成功时回调       
			       success: function(response, options) {       
			           //获取响应的json字符串        
			           Ext.MessageBox.hide();
			           
			           var json = response.responseText;    
	                   var o = Ext.util.JSON.decode(json);
			           
			           if (o.success) {
						   alert("信息审核通过!");
						   handleRefresh();
	                   }else{
			               Ext.Msg.alert('提示', '提交审核失败!'); 
			           }                
			       }      
		     }); 
	    }
  }
  
  function handleQuery(){
      document.form1.action = context + "/app/info.do?method=list4nginfo";
      document.form1.submit();
  }
</script>
<body>
<form id="form2" name="form1" method="post" action=""><input
	type="hidden" name="pageNO" value="<%=pageNO%>">
<h2>信息管理 - 未通过审核信息列表</h2>
<div align="left" style="padding:5px;">
	<img src="<%=context %>/app/info/images/search.png" title="查询栏目信息" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:queryInfo(true);"/>
	<img src="<%=context %>/app/info/images/page_gear.png" title="信息审核通过,可以发布" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleOK();"/>
	<input type="hidden" id="qdirec" name="qdirec" value="<%=qdirec%>"/>
	<input type="hidden" id="qdirecid" name="qdirecid" value="<%=qdirecid%>"/>
	<input type="hidden" id="qname" name="qname" value="<%=qname%>"/>
	<input type="hidden" id="qstatus" name="qstatus" value="-1"/>
	<input type="hidden" id="qdate" name="qdate" value="<%=qdate%>"/>
</div>
<table class="tbl" align="center" width="98%">
	<thead>
		<tr>
			<td align="center" title="全部选择/取消选择" onclick="javascript:checkall();">选择</td>
			<td width="35%" align="center">&nbsp;<font color="#4C4C4C"><b>标题</b></font></td>
			<td width="20%" align="center">&nbsp;<font color="#4C4C4C"><b>所属栏目</b></font></td>
			<td width="15%" align="center">&nbsp;<font color="#4C4C4C"><b>发布时间</b></font></td>
			<td width="10%" align="center">&nbsp;<font color="#4C4C4C"><b>发布人</b></font></td>
			<td width="10%" align="center">&nbsp;</td>
		</tr>
	</thead>
	<tbody>
		<%
				if (resultList != null && !resultList.isEmpty()) {
				for (int i = 0; i < resultList.size(); i++) {
					Map info = (Map) resultList.get(i);
					String number = (String) info.get("PAGINATION_NUMBER");
					String title = HTMLTool.htmlEscape((String) info
					.get("IF_TITLE"));
					String itname = (String) info.get("IT_NAME");
					String idname = (String) info.get("ID_NAME");
					String date = (String) info.get("IF_DATE");
					String username = (String) info.get("IF_USERNAME");
					String id = (String) info.get("IF_ID");
		%>
		<tr onMouseOver="javascript:this.bgColor='#ffff99'"
			onmouseout=" javascript:this.bgColor='#ffffff'" bgColor="#ffffff">
			<td align="center"><input type="checkbox" name="chk" value="<%=id%>">&nbsp;<%=number%></td>
			<td>
			<div class="listtitle" style="width:300px;" title="<%=title%>"><a
				target="_blank" class="ititle"
				href="<%=context%>/app/info.do?method=viewinfo&id=<%=id%>"><%=title%></a></div>
			</td>
			<%
			if (listtype.equals("type")) {
			%>
			<td align="left">&nbsp;<%=itname%></td>
			<%
			}
			%>
			<td align="center" title="<%=idname%>">
			<div class="listtitle" style="width:180px;"><%=idname%></div>
			</td>
			<td align="center">&nbsp;<%=DateTrimmer.getYMDHMS_LBL(date)%></td>
			<td align="center"><%=username%></td>
			<td align="center"><a
							href="javascript:void(0);" class="ititle" onclick="javascript:handleOK('<%=id%>');">发布</a>
						</td>
		</tr>
		<%
			}
			}
		%>
	</tbody>
</table>
<div id="pager">
<div style="float:left;padding:5px;"><%=label.displayLabel()%></div>
<div style="float:right;padding:5px;"><%=label.startLabel()%> <%=label.previousLabel()%>
<%=label.nextLabel()%> <%=label.endLabel()%> <%=controller.getController().toString()%></div>
</div>
<%=controller.getControlScript(true)%></form>
</body>
</html>
